package com.xszn.middleware.controller;

import com.xszn.middleware.entity.RYQueryCondition;
import com.xszn.middleware.entity.RYRequestEntity;
import com.xszn.middleware.service.impl.RuoyingServiceImpl;
import com.xszn.middleware.util.WebSocketUsers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.Session;
import javax.websocket.server.PathParam;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    RuoyingServiceImpl ruoyingService;

    @GetMapping("/aa/{id}")
    public String test(@PathVariable("id") String id){
        Session session = WebSocketUsers.getUsers().get(id);
        RYQueryCondition ryQueryCondition = new RYQueryCondition();
        ryQueryCondition.setNameLike("王硕");
        ryQueryCondition.setLimit(10);
        ryQueryCondition.setOffset(1);
        ryQueryCondition.setCodeLike("1");
        ruoyingService.queryPeople(session, ryQueryCondition);
        return "hello one";
    }
}
